package com.adtech.adms.system.service;

import java.util.List;

import com.adtech.adms.system.pojo.User;
import com.adtech.core.dao.exp.Expression;
import com.adtech.core.dao.query.Pager;
import com.adtech.core.dao.query.Sort;
import com.adtech.core.exception.ServiceException;

/**
 * 用户service
 * 定义用户模块业务操作接口
 * @author Dormin 
 * @since 2011-8-11 
 * 
 * @Copyright (C) AD Tech Workshop All Right Reserved
 */
public interface UserService {

	public List<User> getUserList(Pager pager, Expression expression, Sort sort);
	public void delete(String id,User currentUser) throws ServiceException;

	public void save(User user,User currentUser) throws ServiceException;

	public void update(User user);


	public User getUser(int id);

	public User login(String userName, String password,String ip,String sessionId,String reason) throws ServiceException;

	public void check(User user) throws ServiceException;

	/**
	 * 
	 * @function 修改密码
	 * @param user 用户
	 * @param oldPassword 旧密码
	 * @param newPassword 新密码
	 *
	 * @return
	 * @exception ServiceException
	 *
	 * @author Dormin
	 * @history
	 *
	 */
	public void changePassword(User user,String password,String newPassword,User currentUser) throws ServiceException;

	/**
	 * 
	 * @function 批量重置密码
	 * @param id id字符串
	 *
	 * @return 随机密码
	 * @exception ServiceException
	 *
	 * @author Dormin
	 * @history
	 *
	 */
	public String resetPassword(String id) throws ServiceException ;

	/**
	 * 
	 * @function 检查登录类型
	 * @param user 当前登录用户
	 *
	 * @return
	 * @exception ServiceException
	 *
	 * @author Dormin
	 * @history
	 *
	 */
	public void checkLoginType(User user) throws ServiceException ;

	/**
	 * 
	 * @function 检查用户密码是否正确
	 * @param userId 用户id
	 * @param password 密码
	 *
	 * @return
	 * @exception ServiceException
	 *
	 * @author Dormin
	 * @history
	 *
	 */
	public void checkPassword(Integer userId,String password) throws ServiceException ;

}
